//
//  UserDetailViewController.h
//  IceBreaker
//
//  Created by Chiao Wolfire on 12-10-7.
//  Copyright (c) 2012年 NDS. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "User.h"
#import "AsyncSocket.h"

@interface UserDetailViewController : UIViewController<UITextFieldDelegate, UIAlertViewDelegate, UIImagePickerControllerDelegate,UINavigationControllerDelegate>

@property(nonatomic, strong) User *user;
@property(nonatomic, retain) IBOutlet UILabel *usernameLabel, *genderLabel, *phoneLabel, *addressLabel, *maleLabel, *femaleLabel;
@property(nonatomic, retain) IBOutlet UITextField *usernameFeild, *phoneFeild, *addressFeild;
@property(nonatomic, retain) IBOutlet UIButton *cancelBtn, *regBtn, *maleBtn, *femaleBtn, *pickBtn;
@property(nonatomic, retain) AsyncSocket *mySocket;
@property(nonatomic, retain) UIImage *headImg;
@property(nonatomic, retain) IBOutlet UIImageView *testView;
@property(nonatomic, retain) UIImagePickerController *imagePicker;
@property(nonatomic, retain) NSString *serverIP;
@property(nonatomic, assign) UInt16 connectPort;
@property(nonatomic, assign) NSTimeInterval connectTime;

// register
-(IBAction)regBtnTouched:(id)sender;
// choose gender
-(IBAction)genderTouched:(id)sender;
// touch the view to close the keyboard
-(IBAction)closeViewEdit:(id)sender;
// pick imgae from album
-(IBAction)pickImageFromAlbum;
// pick image from camera
-(IBAction)pickImageFromCamera;
// Create socket connection
-(int) createConnection: (NSString *)hostIP
                   port: (UInt16)hostPort
                timeout: (NSTimeInterval) timeout;
// reconnect
-(IBAction)reConnect:(NSString *) hostIP
                port:(UInt16)hostPort
             timeout:(NSTimeInterval)timeout;

@end
